package top.mhtools.pigeon.common.service.support;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import top.mhtools.pigeon.common.enums.SendTypeEnum;
import top.mhtools.pigeon.common.persistence.SendMessageRequest;
import top.mhtools.pigeon.wechat.service.SendMessageWeChatService;

/**
 * 企业微信发送分解器
 *
 * @author machen
 * @date 2020/4/24 22:22
 */
@Component
public class WeChatSendMessageSolver extends AbstractSendMessageExecuteStrategy {

    @Autowired
    private SendMessageWeChatService sendMessageWeChatService;

    @Override
    public void sendMessage(SendMessageRequest messageRequest) {
        sendMessageWeChatService.sendMessage(messageRequest.getWeChatMessageReqDTO());
    }

    @Override
    public String supports() {
        return SendTypeEnum.WE_CHAT.getName();
    }
}
